<?php
class RegionesController extends AppController{
	var $name = 'Regiones';
	var $components = array('Paginator');
	var $helpers = array('Html', 'Form');
	
	function getData ($id_pais) {
		$this->layout = 'ajax';
		$regiones = false;
		if (is_numeric($id_pais)) {
			$region = new Regione(true, array('recursive' => -1));
			/*$regiones = $region->generateList(array(
				'conditions' => array('Region.Pais' => $id_pais)
			));*/
			$regiones = $region->find('list', array(
				'fields' => 'Paise.nombre',
				'conditions' => array('Region.Pais' => $id_pais))
			);
			
			
		}
		
		$this->set('data', $regiones);
	}
}
?>